/*
 * \brief  Nitpicker view interface
 * \author Norman Feske
 * \date   2006-08-10
 */

/*
 * Copyright (C) 2006-2009 Norman Feske
 * Genode Labs, Feske & Helmuth Systementwicklung GbR
 *
 * This file is part of the Genode OS framework, which is distributed
 * under the terms of the GNU General Public License version 2.
 */

#ifndef _INCLUDE__NITPICKER_VIEW__NITPICKER_VIEW_H_
#define _INCLUDE__NITPICKER_VIEW__NITPICKER_VIEW_H_

#include <nitpicker_session/nitpicker_session.h>
#include <nitpicker_view/capability.h>

namespace Nitpicker {

	class View
	{
		protected:

			enum Opcode { VIEWPORT, STACK, TITLE };

		public:

			virtual ~View() { }

			/**
			 * Define position and viewport
			 *
			 * Both attributes are handled in one function to enable atomic
			 * updates of position and viewport. This is the common case for
			 * moving an overlay window.
			 */
			virtual int viewport(int x, int y, int w, int h,
			                     int buf_x, int buf_y, bool redraw = true) = 0;

			/**
			 * Reposition view in view stack
			 *
			 * \param neighbor  neighbor view
			 * \param behind    insert view in front (true) or
			 *                  behind (false) the specified neighbor
			 * \param redraw    redraw affected screen region
			 *
			 * To insert a view at the top of the view stack, specify
			 * neighbor = invalid and behind = true. To insert a view at the
			 * bottom of the view stack, specify neighbor = invalid and
			 * behind = false.
			 */
			virtual int stack(View_capability neighbor = View_capability(),
			                  bool behind = true, bool redraw = true) = 0;

			/**
			 * Assign new view title
			 */
			virtual int title(const char *title) = 0;
	};
}

#endif /* _INCLUDE__NITPICKER_VIEW__NITPICKER_VIEW_H_ */
